#include "main_loop.h"
#include "as5600.h"
#include "uart.h"
#include "timer_loop.h"
extern UART_HandleTypeDef huart1;
extern uint16_t g_time_10ms_fg;
#define WIFI_Pin GPIO_PIN_3
#define WIFI_Port GPIOA
void main_loop(void)
{
    float angle;
    InitUartData();
    As5600Init();
    timer_start();
    PWMInit();
    HAL_GPIO_WritePin(WIFI_Port, WIFI_Pin, GPIO_PIN_SET);
    while (1)
    {
        if (g_time_10ms_fg == 1)
        {
            velocity_open_loop(0.01);
            Vofa_Send();
            EnableUart();
            g_time_10ms_fg = 0;
        }
    }
}